home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Filename: Default.GPDScript
- ;
- ; This is the script that I use. I have included it so it can be
- ; used as a template. You should save this file with a different
- ; name and modify as required.
- ;
- show abort all
- print "Trying to connect to $GPD_SITE "
- ;
- ; This is needed to allow GPDial to exit without hanging up the modem
- ;
- send "$GPD_DTROFF"
- wait "OK" 5 FAILED
- LAB REDIAL:
- ;
- ; Call my provider and wait for a connection
- ;
- show abort all
- send "$GPD_PREDIAL $GPD_PHONENUMBER$GPD_SUFDIAL"
- wait "$GPD_CONNECTED" OR "$GPD_BUSY" OR "ENGAGED" 40 HANGUP
- if $GPD_STRING != $GPD_CONNECTED
- goto SMALLPAUSE
- endif
- ;
- ; My provider asks me to press return before login starts
- ;
- wait "Press return to start login:" 30 HANGUP
- send "\r"
- ;
- ; The LOGIN prompt
- ;
- wait "username:" OR "NO CARRIER" 30 HANGUP
- ;
- ; My provider will hangup at this point if there is not enough
- ; resources to allow me to login.
- ;
- if $GPD_STRING = "NO CARRIER"
- goto FAILED
- endif
- send $GPD_USERNAME
- ;
- ; The PASSWORD prompt
- ;
- wait "password:" 30 HANGUP
- send $GPD_PASSWORD hide
- ;
- ; The type of connection I wish
- ;
- wait "ppp:" 30 HANGUP
- send "slip\r"
- ;
- ; Find out my IP address (It is assigned at login time)
- ; The provider sends the string
- ; "You're connected to 256.256.256.256 Your address is 256.256.256.256."
- ;
- waitline "Your address is" 30 HANGUP
- ;
- ; Extract the dynamicaly allocated IP address.
- ;
- print "Connection established to $GPD_SITE - Starting TCP/IP"
- extract $GPD_LINE 8
- ;
- ; Now remove the full stop that is at the end of the word
- ;
- remchar $GPD_VALUE -1
- ;
- ; I need to set this IP address into 3 files. startnet, netdb-myhost and
- ; rhslip0.config. I do this by having ".store" files for each with the IP
- ; address of 0.0.0.0 I then do a find and replace (using the Replace
- ; command)
- ;
- execute "replace AmiTCP:bin/startnet.store AmiTCP:bin/startnet 0.0.0.0 $GPD_TEXT -s" ERRORMSG
- execute "replace AmiTCP:db/netdb-myhost.store AmiTCP:db/netdb-myhost 0.0.0.0 $GPD_TEXT -s" ERRORMSG
- execute "replace ENVARC:sana2/rhslip0.config.store ENVARC:sana2/rhslip0.config 0.0.0.0 $GPD_TEXT -s" ERRORMSG
- ;
- ; Now close the serial device so that we can start AmiTCP
- ;
- close
- ;
- ; Now start TCP
- ;
- execute "execute AmiTCP:bin/startnet" ERRORMSG
- execute "AmiTCP:bin/online rhslip.device 0" ERRORMSG
- print "TCP/IP now running"
- quit
- ;
- ; By now everything is up and running (hopefully) so we quit GPDial
- ;
- ; The following lines of script will be jumped to by an error
- ;
- LAB FAILED:
- printerror "Error connecting"
- end
- ;
- LAB ERRORMSG:
- printerror "Error starting TCP/IP - Check files"
- end
- ;
- LAB HANGUP:
- send $GPD_HANGUP
- goto SMALLPAUSE
- end
- ;
- LAB SMALLPAUSE:
- print "Hanging up and trying again"
- pause 10
- print "Redialing .."
- goto REDIAL
- end
- ;
- ; EOF
-